<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Common\Tools\ImageUrl;

class Photo extends Model
{
    protected $table = 'photos';
    protected $guarded = [];

    public function getPathAttribute($url)
    {
        return ImageUrl::make($url);
    }


    public function category()
    {
        return $this->hasOne('App\Models\Category', 'id', 'category_id');
    }

}